<script>
import Number from "./components/number.vue"
import addressForm from "./formControl/addressForm.vue";
import vehicleTypeForm from "./formControl/vehicleTypeForm.vue";
import goodsInfo from "./formControl/goodsInfo.vue";
import Modal from "./components/Modal.vue"
import TestData from "./test/TestData.vue"
import GoodsType from "./enum/GoodsType"
import releOrder from "./formControl/releOrder.vue"
import upload from '@/components/upload.vue'
import serviceForm2 from "./formControl/serviceForm2.vue"
export default {
	components: {
		Number,
		addressForm,
		vehicleTypeForm,
		Modal,
		goodsInfo,
		TestData,
		releOrder,
		upload,
		serviceForm2
	},
	data() {
		return {
			startDate: '',
			showService: false,
			load_num: 0, //装货次数
			unload_num: 0, //卸货次数
			cityValue: "",
			departure: {},
			reach: {},
			GoodsType,
			//==============
			addressText: "",
			addressContent: "",
			addressSelectTitle: "",
			addressAreaId: "",
			addressKey: "",
			addressFormShow: false,
			//===============
			count: 11,
			// 货物清单文件列表
			fileList2: [],
			// 支持的文件类型
			acceptTypes: ['doc', 'docx', 'xls', 'xlsx', 'pdf'],
			// 运输方式选项
			transportWayTypes: [{
				id: 0,
				name: this.$t('不限')
			},
			{
				id: 2,
				name: this.$t('汽运')
			},
			{
				id: 3,
				name: this.$t('空运')
			},
			{
				id: 4,
				name: this.$t('海运')
			},
			{
				id: 5,
				name: this.$t('铁路')
			},
			{
				id: 1,
				name: this.$t('其他')
			}
			],
			// 当前选择的运输方式索引
			transportIndex: 0,
			showVehicleType: false, // 控制载具类型弹窗
			selectedVehicleType: null, // 已选择的载具类型
			// 运输类型选项
			transportTypes: [{
				id: 1,
				name: this.$t('整车')
			},
			{
				id: 2,
				name: this.$t('拼车')
			}
			],
			// 当前选择的运输类型
			selectedTransportType: 1,
			// 已选的载具 车皮 车长 车型 中文
			size_title: '',
			vehicle_title: '',
			railway_wagon_title: '',
			showGoodsInfo: false,
			currentGoodsInfo: {},
			showReleOrder: false,
			testShow: false,
			orderId: ''
		}
	},

	computed: {
		// 当前选择的运输方式名称
		currentTransportName() {
			return this.transportWayTypes[this.transportIndex]?.name || this.$t('请选择运输方式')
		}
	},
	onLoad(options) {
		this.startDate =  this.getNowFormatDate();
		setTimeout(() => {
			this.testShow = true
		}, 100)
		// 初始化货物数量
		if (!this.$store.state.publishCommonBody.goods_num) {
			this.$store.state.publishCommonBody.goods_num = 1
		}
		// 初始化用户id
		if (!this.$store.state.publishCommonBody.user_id) {
			this.$store.state.publishCommonBody.user_id = uni.getStorageSync('user_id')
		}
		// 初始化货物类型
		if (!this.$store.state.publishCommonBody.delivery_type) {
			this.$store.state.publishCommonBody.delivery_type = 0
		}
		//初始化运输类型
		if (!this.$store.state.publishCommonBody.transport_type) {
			this.$store.state.publishCommonBody.transport_type = 1
		}
		//初始化运输方式
		if (!this.$store.state.publishCommonBody.transport_way) {
			this.$store.state.publishCommonBody.transport_way = 0
		}

		window.sendTest = (e) => {
			console.log(e);
		}
		
		if(options.orderId) {
			this.orderId = options.orderId
		}
	},
	methods: {
		getNowFormatDate() {
			let date = new Date(),
			year = date.getFullYear(), //获取完整的年份(4位)
			month = date.getMonth() + 1, //获取{{$t('当前')}}月份(0-11,0代表1月)
			strDate = date.getDate() // 获取{{$t('当前')}}日(1-31)
			if (month < 10) month = `0${month}` // 如果月份{{$t('是')}}个位数，在前面补0
			if (strDate < 10) strDate = `0${strDate}` // 如果日是个位数，在前面补0
			console.log('this.startDate---', `${year}-${month}-${strDate}`)
			return `${year}-${month}-${strDate}`
		},
		unloadConfirm() {
			this.$store.state.publishCommonBody.unload_num = this.unload_num
			this.$store.state.publishCommonBody.load_num = this.load_num
			this.showService = false
		},
		handleUpload(e) {
			console.log(e.url)
			console.log(e.fullurl)
			const filename = e.fullurl.split('.');
			console.log(JSON.stringify(filename))
			this.fileList2.push({
				name: e.fullurl.split("/")[e.fullurl.split("/").length - 1],
				fullurl: e.fullurl,
				status: 'success',
				message: '',
			})
			this.$store.state.publishCommonBody.goods_list = this.fileList2
				.filter(item => item.status === 'success')
				.map(item => item.fullurl)
				.join(',');
				
			console.log('this.$store.state.publishCommonBody.goods_list----',this.$store.state.publishCommonBody.goods_list);
		},
		submit() {
			//参数验证
			//{{$t('运输')}}{{$t('服务')}}包含{{$t('运输')}}
			if (this.$store.state.publishCommonBody.demand.split(",").includes("1") || this.$store.state.publishCommonBody.goods_type == GoodsType.XIAOJIAN) {
				if (!this.$store.state.publishCommonBody.departure_id) {
					return uni.showToast({
						title: this.$t('请添加起点'),
						icon: 'none'
					})
				}
				if (!this.$store.state.publishCommonBody.reach_id) {
					return uni.showToast({
						title: this.$t('请添加终点'),
						icon: 'none'
					})
				}
			}

			//{{$t('货物信息')}}
			if (!this.$store.state.publishCommonBody.goods_id) {
				return uni.showToast({
					title: this.$t('请填写货物信息'),
					icon: 'none'
				})
			}
			//{{$t('装货时间')}}{{$t('必填')}}
			if (!this.$store.state.publishCommonBody.delivery_at) {
				return uni.showToast({
					title: this.$t('请填写装货时间'),
					icon: 'none'
				})
			}
			//{{$t('需求数量')}}小于1
			if (this.$store.state.publishCommonBody.goods_num < 1) {
				return uni.showToast({
					title: '需求数量不能小于1',
					icon: 'none'
				})
			}
			//运输方式如果不是不限,那么必须选择载具类型
			if (this.$store.state.publishCommonBody.transport_way != 0 && this.$store.state.publishCommonBody.transport_way != 1) {
				console.log('this.$store.state.publishCommonBody-',this.$store.state.publishCommonBody)
				// if (!this.$store.state.publishCommonBody.vehicle_id) {
				// 	return uni.showToast({
				// 		title: this.$t('请选择载具类型'),
				// 		icon: 'none'
				// 	})
				// }
			}
			console.log('this.orderId---33333', this.orderId)
			uni.redirectTo({
				url: `/pages/publish/publishStep2?orderId=${this.orderId}`,
				notInFrame: true
			})
		},
		setService() {
			uni.navigateTo({
				url: "/pages/publish/formControl/serviceForm"
			})
		},
		back() {
			this.cback()
			// uni.navigateBack()
		},
		addressSelectConfirm(addressData) {
			console.log(addressData);
			if (this.addressKey == "departure") {
				this.$store.commit("setKeyValue", {
					k: "publishDeparture",
					v: addressData
				})
				this.$store.state.publishCommonBody.departure_id = addressData.id
			}
			if (this.addressKey == "reach") {
				this.$store.commit("setKeyValue", {
					k: "publishReach",
					v: addressData
				})
				this.$store.state.publishCommonBody.reach_id = addressData.id
			}
			//初始化地址选择
			this.addressKey = ""
			this.addressSelectTitle = ""
			this.addressFormShow = false;

		},
		selectAddress(key) {
			const text = {
				departure: this.$t('设置起点城市'),
				reach: this.$t('设置终点城市')
			}
			this.addressKey = key
			this.addressSelectTitle = text[key]
			this.addressFormShow = true;

			//已有选择地址
			if (this.$store.state[key == 'departure' ? 'publishDeparture' : 'publishReach'].content) {
				this.addressAreaId = this.$store.state[key == 'departure' ? 'publishDeparture' : 'publishReach']
					.area_id
				this.addressContent = this.$store.state[key == 'departure' ? 'publishDeparture' : 'publishReach']
					.content
				this.addressText = this.get(this.$store.state[key == 'departure' ? 'publishDeparture' :
					'publishReach'], 'area.mergename')
			} else {
				this.addressAreaId = ""
				this.addressContent = ""
				this.addressText = ""
			}
			// uni.navigateTo({
			// 	url: "/pages/publish/formControl/addressForm"
			// })
		},
		// 删除货物清单文件
		deleteFile(index) {
			this.fileList2.splice(index, 1)
			// 更新store中的货物清单
			this.$store.state.publishCommonBody.goods_list = this.fileList2.map(item => item.url).join(',')
		},
		// 选择文件
		chooseFile() {
			uni.chooseFile({
				count: 5, // 最多选择5个文件
				type: 'all',
				extension: ['.doc', '.docx', '.xls', '.xlsx', '.pdf'],
				success: (res) => {
					this.uploadFiles(res.tempFiles)
				},
				fail: (err) => {
					console.log(this.$t('选择文件失败'), err)
				}
			})
		},
		// 上传多个文件
		async uploadFiles(files) {
			// 添加上传中状态
			const startIndex = this.fileList2.length
			files.forEach(file => {
				this.fileList2.push({
					name: file.name,
					status: 'uploading',
					message: this.$t('上传中'),
					size: file.size
				})
			})

			// {{$t('上传')}}文{{$t('件')}}
			for (let i = 0; i < files.length; i++) {
				try {
					const result = await this.uploadFile(files[i].path)
					console.log('result----',result);
					this.fileList2.splice(startIndex + i, 1, {
						url: result,
						name: files[i].name,
						status: 'success',
						message: '',
						size: files[i].size
					})

				
					this.$store.state.publishCommonBody.goods_list = this.fileList2
						.filter(item => item.status === 'success')
						.map(item => item.url)
						.join(',')
				} catch (e) {
					this.fileList2.splice(startIndex + i, 1)
					uni.showToast({
						title: this.$t('上传失败'),
						icon: 'none'
					})
				}
			}
		},
		// 上传单个文件
		uploadFile(filePath) {
			return new Promise((resolve, reject) => {
				uni.uploadFile({
					url: 'https://app.gluz.com.cn/api/common/upload',
					filePath: filePath,
					name: 'file',
					success: (res) => {
						try {
							const data = JSON.parse(res.data)
							resolve(data.data.url)
						} catch (e) {
							reject(e)
						}
					},
					fail: reject
				})
			})
		},
		// {{$t('运输方式')}}改变
		onTransportChange(e) {
			this.transportIndex = e.detail.value
			// 更新store{{$t('中')}}的{{$t('运输方式')}}
			this.$store.state.publishCommonBody.transport_way = this.transportWayTypes[this.transportIndex].id
			//{{$t('清空')}}{{$t('载具类型')}}
			this.onVehicleTypeConfirm({
				length: {},
				type: {},
				railway_wagon: {}
			})
		},
		// {{$t('选择')}}{{$t('运输类型')}}
		selectTransportType(typeId) {
			this.selectedTransportType = typeId
			// 更新store中的运输类型
			this.$store.state.publishCommonBody.transport_type = typeId
		},
		onVehicleTypeConfirm(data) {
			this.showVehicleType = false
			this.$store.state.publishCommonBody.size_id = data.length.id
			this.$store.state.publishCommonBody.vehicle_id = data.type.id
			this.$store.state.publishCommonBody.railway_wagon = data.railway_wagon.id
			//把已选的载具 车皮 车长 车型的title存到data
			this.size_title = data.length.title
			this.vehicle_title = data.type.title
			this.railway_wagon_title = data.railway_wagon.title

			this.$store.state.publishCommonBody.size_title = this.size_title
			this.$store.state.publishCommonBody.vehicle_title = this.vehicle_title
			this.$store.state.publishCommonBody.railway_wagon_title = this.railway_wagon_title
			console.log(this.vehicle_title);

		},
		log(o) {
			console.log(o);
		},
		onGoodsInfoConfirm(data) {
			console.log(data);
			this.currentGoodsInfo = data
			this.showGoodsInfo = false
			this.$store.commit("setKeyValue", {
				k: "currentGoodsInfo",
				v: data
			})
		},
		onReleOrderConfirm(data) {
			console.log(data);
			this.showReleOrder = false
			this.$store.state.publishCommonBody.related_orders = data.join(",")
		}
	}
}
</script>

<template>
	<view class="publish flex between flex-col">



		<!-- 载具类型弹窗 -->
		<Modal :show.sync="showVehicleType" :title="$t('请选择载具类型')">
			<div style="height: 90vh;width: 100%;">
				<vehicleTypeForm @confirm="onVehicleTypeConfirm" />
			</div>
		</Modal>

		<!-- @click="go('/pages/publish/formControl/goodsInfo')" -->
		<!-- 货物信息弹窗 -->
		<Modal :show.sync="showGoodsInfo" :title="$t('请选择货物信息')">
			<div class="w-full" style="height: 80vh;">
				<goodsInfo @confirm="onGoodsInfoConfirm" />
			</div>
		</Modal>

		<!-- 关联订单弹窗 -->
		<Modal :show.sync="showReleOrder" :title="$t('请选择关联订单')">
			<div class="w-full" style="height: 80vh;background-color: #f5f5f5">
				<releOrder @confirm="onReleOrderConfirm" />
			</div>
		</Modal>

		<!-- <div class="modal">
			<div class="modal-content">
				<div class="font-bold">{{$t('请选择通关执行城市')}}</div>
				<div class="text-white bg-primary mt-50 h-90 rounded-50 center fz32 font-bold" style="width: 370rpx;"
					@click="setService">{{$t('确定')}}
				</div>
			</div>
		</div> -->
		<!-- 载具类型弹窗 -->
		<!-- <div>
			<u-popup :show="showVehicleType" mode="bottom" @close="showVehicleType = false">
				<div style="height: 90vh">
					<vehicleTypeForm :transport_way="$store.state.publishCommonBody.transport_way"
						@confirm="onVehicleTypeConfirm" />
				</div>
			</u-popup>
		</div> -->

		<!-- 地址选择弹窗 -->
		<div>
			<u-popup :show="addressFormShow">
				<addressForm :show.sync="addressFormShow" :title="addressSelectTitle"
					@addressSelectConfirm="addressSelectConfirm" :content="addressContent" :area_id="addressAreaId"
					:address="addressText" />
			</u-popup>
		</div>
		<!-- 头部 -->
		<div style="height:50rpx"></div>
		<div class="header">
			<div class="back center" @click="back">
				<image src="/static/icon/back.png" mode="widthFix" class="w-20"></image>
			</div>
			{{$t('订单发布')}}
		</div>

		<div class="content p-30 flex-1" style="padding-top: 0;overflow: auto;">

			<div class="bg-white rounded-26 p-20 between"
				v-if="$store.state.publishCommonBody.goods_type != GoodsType.XIAOJIAN" @click="showReleOrder = true">
				<div class="font-bold fz28">{{$t('关联订单')}}</div>
				<div class="flex">
					<div class="bg-primary pl-30 pr-30 mr-20 rounded-50 text-white">
						{{ this.$store.state.publishCommonBody.related_orders.split(",").filter(item => item).length }}
					</div>
					<image src="/static/icon/right-2.png" mode="widthFix" class="w-10"></image>
				</div>
			</div>

			<div class="bg-white rounded-26 p-15  mt-20"
				v-if="$store.state.publishCommonBody.demand.split(',').includes('1') || $store.state.publishCommonBody.goods_type == GoodsType.XIAOJIAN">

				<div class="bg-gray-600 w-full rounded-16  flex p-20 between" style="min-height:100rpx"
					@click="selectAddress('departure')">
					<div class="flex">
						<image src="/static/icon/start.png" mode="widthFix" class="w-40"></image>
						<div class="font-bold fz32 ml-24 text-333"
							v-if="!get($store.state.publishDeparture, 'area.mergename')">
							{{$t('请添加起点')}}
						</div>
						<div class="ml-24" v-else>
							<div class="fz32 font-bold text-111">{{ get($store.state.publishDeparture,
								"area.mergename") }}</div>
							<div class="fz24 mt-12 text-888 pr-30" style="word-break: break-word;">{{
								$store.state.publishDeparture.content }}</div>
						</div>
					</div>
					<image src="/static/icon/right-3.png" mode="widthFix" class="w-10"></image>
				</div>

				<!-- <div class="bg-gray-600 w-full rounded-16  flex p-20 between mt-15" style="min-height:100rpx"
					@click="selectAddress()">
					<div class="flex">
						<image src="/static/icon/way.png" mode="widthFix" class="w-40"></image>
						<div class="font-bold fz32 ml-24 text-333">
							{{$t('请添加终点')}}
						</div>
					</div>
					<image src="/static/icon/right-3.png" mode="widthFix" class="w-10"></image>
				</div> -->

				<div class="bg-gray-600 w-full rounded-16  flex p-20 between mt-15" style="min-height:100rpx"
					@click="selectAddress('reach')">
					<div class="flex">
						<image src="/static/icon/end.png" mode="widthFix" class="w-40"></image>
						<div class="font-bold fz32 ml-24 text-333"
							v-if="!get($store.state.publishReach, 'area.mergename')">
							{{$t('请添加终点')}}
						</div>
						<div class="ml-24" v-else>
							<div class="fz32 font-bold text-111">{{ get($store.state.publishReach, "area.mergename")
								}}</div>
							<div class="fz24 mt-12 text-888 pr-30" style="word-break: break-word;">{{
								$store.state.publishReach.content }}</div>
						</div>
					</div>
					<image src="/static/icon/right-3.png" mode="widthFix" class="w-10"></image>
				</div>

				<div class="bg-gray-600 w-full rounded-16 center flex-col flex p-20  mt-15" style="min-height:100rpx"
					@click="showService = true" v-if="$store.state.publishCommonBody.goods_type != GoodsType.XIAOJIAN">
					<div class="center w-full h-full">
						<image src="/static/icon/add.png" mode="widthFix" class="w-25 mt-5"></image>
						<div class="fz26 text-gray-900 ml-10"
							v-if="!$store.state.publishCommonBody.load_num && !$store.state.publishCommonBody.unload_num">
							{{$t('设置装卸次数')}}</div>
						<div class="fz26 text-gray-900 ml-10" v-else>{{ $store.state.publishCommonBody.load_num }}{{$t('装')}}/{{
							$store.state.publishCommonBody.unload_num }}{{$t('卸')}}</div>
					</div>
				</div>

				<u-popup :show="showService" border-radius="20">
					<div class="w-full h-full p-30">
						<div class="center mb-50 font-bold relative">
							<div class="absolute right-0 top-0" @click="showService = false">
								<image src="/static/icon/close.png" mode="widthFix" class="w-25"></image>
							</div>
							{{$t('设置装卸次数')}}
						</div>
						<div class="between py-30">
							<div class="fz30 font-bold text-1d1d1d">{{$t('装')}}</div>
							<Number v-model="load_num" :unit="$t('次')" />
						</div>
						<div class="between py-30">
							<div class="fz30 font-bold text-1d1d1d">{{$t('卸')}}</div>
							<Number v-model="unload_num" :unit="$t('次')" />
						</div>
						<div class="bg-primary text-white rounded-50 center fz32 font-bold w-full h-90 mt-50"
							@click=" unloadConfirm()">{{$t('确定')}}
						</div>
					</div>
				</u-popup>

			</div>


			<div class="bg-white rounded-26 p-20 mt-20">
				<div class="between">
					<div class="flex">
						<div class="text-555 fz28">{{$t('货物信息')}}</div>
						<div class="bg-blue-2 text-blue fz22 rounded-30 text-blue-2 ml-24 pt-5 pb-5 pl-14 pr-14">{{$t('必填')}}
						</div>
					</div>

					<div class="flex" @click="showGoodsInfo = true">
						<div class="fz28 text-333 font-bold ellipsis" style="width: 400rpx;text-align: right;">
							<!-- 办公用品/2吨/4立方米/木架装 -->
							<template v-if="currentGoodsInfo.title">
								{{ currentGoodsInfo.title }}/{{ currentGoodsInfo.goods_weight }}{{$store.state.publishCommonBody.goods_type == GoodsType.DAJIAN ? '吨' : '千克'}}/{{
									currentGoodsInfo.goods_volume }}{{$t('立方米')}}/{{ currentGoodsInfo.package.title }}
							</template>
							<template v-else>
								{{$t('填写货物信息')}}
							</template>
						</div>
						<image src="/static/icon/right-2.png" mode="widthFix" class="w-10 ml-15"></image>
					</div>
				</div>
				<div class="between mt-40 between">
					<div class="flex">
						<div class="text-555 fz28">{{$t('货物清单')}}</div>
					</div>
					<div class="flex">
						<div style="position: relative;">
							<div class="bg-primary text-white rounded-30 fz28 pl-40 pr-40 pt-10 pb-10 center"
								style="position: absolute;top: 0;right: 0;width: 200rpx;height: 60rpx;">
								{{$t('文件选择')}}
							</div>
							<upload @change="handleUpload" style="opacity: 0;" />
						</div>
					</div>
				</div>
				<div class="file-item mt-20" v-for="(item, index) in fileList2" :key="index">
					<div class="flex">
						<u-icon name="file-text" size="40rpx" color="#278AFF"></u-icon>
						<div class="fz28 ml-14 text-111">
							{{ item.name || $t('货物清单') }}
							<text v-if="item.status === 'uploading'" class="fz24 text-888">
								({{ item.message }})
							</text>
						</div>
					</div>
					<image v-if="item.status === 'success'" src="/static/icon/del.png" mode="widthFix" class="w-30"
						@click="deleteFile(index)"></image>
				</div>

			</div>

			<div class="bg-white rounded-26 p-20 mt-20">
				<div class="between">
					<div class="flex">
						<div class="text-555 fz28">{{$t('运输类型')}}</div>
						<div class="bg-blue-2 text-blue fz22 rounded-30 text-blue-2 ml-24 pt-5 pb-5 pl-14 pr-14">{{$t('必填')}}
						</div>
					</div>
					<div class="flex fz28 text-333">
						<div class="font-bold flex" v-for="type in transportTypes" :key="type.id"
							@click="selectTransportType(type.id)">
							<div class="radio mr-20" :class="{ 'checked': selectedTransportType === type.id }"></div>
							{{ type.name }}
							<div class="ml-50" v-if="type.id === 1"></div>
						</div>
					</div>
				</div>


				<div class="between mt-40">
					<div class="flex">
						<div class="text-555 fz28">{{$t('运输方式')}}</div>
					</div>
					<div class="flex">
						<picker :range="transportWayTypes" range-key="name" :value="transportIndex"
							@change="onTransportChange">
							<div class="flex">
								<div class="fz26 text-888">{{ currentTransportName }}</div>
								<image src="/static/icon/right-2.png" mode="widthFix" class="w-10 ml-15"></image>
							</div>
						</picker>
					</div>
				</div>

				<div class="between mt-40"
					v-if="$store.state.publishCommonBody.transport_way != 0 && $store.state.publishCommonBody.transport_way != 1"
					@click="$store.state.publishCommonBody.transport_way ? (showVehicleType = true) : toast('请先选择运输方式')">
					<div class="flex">
						<div class="text-555 fz28">{{$t('载具类型')}}</div>
					</div>
					<div class="flex">
						<div class="fz26 text-888" v-if="!size_title && !vehicle_title && !railway_wagon_title">{{$t('请选择载具类型')}}
						</div>
						<div class="fz26 text-888" v-else>
							{{ [size_title, vehicle_title, railway_wagon_title].filter(Boolean).join('/') }}
						</div>
						<image src="/static/icon/right-2.png" mode="widthFix" class="w-10 ml-15"></image>
					</div>
				</div>

				<div class="between mt-40">
					<div class="flex">
						<div class="text-555 fz28">{{$t('需求数量')}}</div>
					</div>
					<div class="flex">
						<Number v-model="$store.state.publishCommonBody.goods_num" />
					</div>
				</div>

			</div>
			<div class="bg-white rounded-26 p-20 mt-20">
				<div class="between">
					<div class="flex">
						<div class="text-555 fz28">{{$t('装货时间')}}</div>
						<div class="bg-blue-2 text-blue fz22 rounded-30 text-blue-2 ml-24 pt-5 pb-5 pl-14 pr-14">{{$t('必填')}}
						</div>
					</div>
					<div class="flex fz28 text-333">
						<picker mode="date"  :start="startDate" @change="e => {
							log([e.detail.value, new Date(e.detail.value).getTime(), new Date().getTime()])

							if (new Date(e.detail.value).getTime() < new Date(new Date().setHours(0, 0, 0, 0)).getTime()) {
								toast('时间不能小于今日')
								$store.state.publishCommonBody.delivery_at = ''
								return
							}
							$store.state.publishCommonBody.delivery_at = e.detail.value
						}">
							<div class="flex">
								<view class="fz26 text-888">
									{{ $store.state.publishCommonBody.delivery_at ?
										$store.state.publishCommonBody.delivery_at :
										$t('请选择装货时间') }}
								</view>
								<image src="/static/icon/right-2.png" mode="widthFix" class="w-10 ml-15"></image>
							</div>
						</picker>
					</div>
				</div>
			</div>
			<!-- 数据 -->
			<!-- <pre>
			{{ JSON.stringify($store.state.publishCommonBody, false, 4) }}
		</pre> -->

			<!-- <TestData /> -->

			<!-- 数据 -->

			<div style="height: 200rpx;"></div>
		</div>



		<div class="form-control p-30 bg-white">
			<div class="submit center h-100 bg-primary text-white fz32 rounded-50" @click="submit">
				{{$t('确认下单')}}
			</div>
		</div>





	</view>
</template>



<style lang="less">
.text-gray-3d3d3d {
	color: #3d3d3d;
}

.right-0 {
	position: absolute;
	right: 30rpx;
	top: 30rpx;
}

.file-item {
	background-color: #F7F7F7;
	border-radius: 18rpx;
	height: 88rpx;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 25rpx;
	margin-bottom: 16rpx;

	&:last-child {
		margin-bottom: 0;
	}
}



.radio {
	border: 1rpx solid #999;
	width: 30rpx;
	height: 30rpx;
	border-radius: 50%;

	&.checked {
		border: 8rpx solid #278AFF;
	}
}

.bg-gray-600 {
	background-color: #F6F7FB;
}

.form-control {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	z-index: 9;
}

.header {
	font-size: 34rpx;
	height: 100rpx;
	line-height: 100rpx;
	font-weight: bold;
	text-align: center;
	position: relative;
	padding-top: var(--status-bar-height);
}

.back {
	position: absolute;
	width: 70rpx;
	height: 70rpx;
	top: 18rpx;
}

page {
	height: 100%;
	width: 100%;
}

.publish {
	height: 100%;
	align-items: stretch;
	background: #F6F7FB url("/static/bg/publish.png") no-repeat;
}

.modal {
	background: rgba(0, 0, 0, 0.5);
	width: 100%;
	height: 100%;
	z-index: 50;
	position: fixed;
	display: flex;
	align-items: center;
	justify-content: center;

	.modal-content {
		background: #fff url("/static/bg/modal.png");
		background-position: top;
		width: 570rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 28rpx;
		padding: 50rpx 0;
		flex-direction: column;
	}
}

.goods_list {
	padding: 40rpx 24rpx;

	.title {
		font-size: 28rpx;
		font-weight: 600;
		margin-bottom: 20rpx;

		.subtitle {
			font-size: 24rpx;
			color: #999;
			font-weight: normal;
		}
	}

	.upload-btn {
		width: 200rpx;
		height: 200rpx;
		background: #F6F7FB;
		border-radius: 12rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;

		.add-icon {
			width: 40rpx;
			margin-bottom: 10rpx;
		}

		text {
			font-size: 24rpx;
			color: #999;
		}
	}

	.file-list {
		margin-top: 20rpx;

		.file-item {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 20rpx;
			background: #F6F7FB;
			border-radius: 12rpx;
			margin-bottom: 16rpx;

			.file-info {
				display: flex;
				align-items: center;

				.file-name {
					font-size: 26rpx;
					color: #333;
					margin-left: 16rpx;
				}
			}

			.file-action {
				.del-icon {
					width: 32rpx;
				}

				.uploading {
					font-size: 24rpx;
					color: #999;
				}
			}
		}
	}
}
</style>